import React from "react";
import style from "./style.module.scss";
import myIconCamera from "../../assets/images/icon/hdpi/my_icon_camera_n.png";

interface PropsType {
  backgroundImg: string;
  overlayContent?: React.ReactNode;
  onClick?: Function;
}

const MyCard: React.FC<PropsType> = ({
  backgroundImg,
  overlayContent,
  onClick,
}) => {
  return (
    <div className={style.figure_box} onClick={() => onClick && onClick()}>
      <img src={backgroundImg} alt="" className={style.backgroundUrl} />
      {overlayContent ? (
        <>{overlayContent}</>
      ) : (
        <>
          <div className={style.uploadFigure}>
            <img src={myIconCamera} alt="" />
            <div>点击拍摄/上传人像面</div>
          </div>
        </>
      )}
    </div>
  );
};

export default MyCard;
